package com.asiainfo.system.management.service.impl;

import com.asiainfo.framework.web.page.PageResult;
import com.asiainfo.framework.web.page.Pagination;
import com.asiainfo.system.management.domain.model.SysOperLog;
import com.asiainfo.system.management.service.SysOperLogService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 操作日志 服务层处理
 */
@Service
public class SysOperLogServiceImpl extends SystemManagementBaseService implements SysOperLogService {

    /**
     * 新增操作日志
     *
     * @param operLog 操作日志对象
     */
    @Override
    public void insertOperlog(SysOperLog operLog) {
        dao.insert("SysMgr.SysOperLog.insertOperlog", operLog);
    }

    /**
     * 查询系统操作日志集合
     *
     * @param page
     * @param operLog 操作日志对象
     * @return 操作日志集合
     */
    @Override
    public PageResult<SysOperLog> selectOperLogList(Pagination page, SysOperLog operLog) {
        return dao.selectList("SysMgr.SysOperLog.selectOperLogList", operLog, page);
    }

    @Override
    public List<SysOperLog> selectOperLogList(SysOperLog operLog) {
        return dao.selectList("SysMgr.SysOperLog.selectOperLogList", operLog);
    }


    /**
     * 批量删除系统操作日志
     *
     * @param ids 需要删除的数据
     * @return
     */
    @Override
    public int deleteOperLogByIds(Integer[] ids) {
        return dao.delete("SysMgr.SysOperLog.deleteOperLogByIds", ids);
    }

    /**
     * 查询操作日志详细
     *
     * @param operId 操作ID
     * @return 操作日志对象
     */
    @Override
    public SysOperLog selectOperLogById(Integer operId) {
        return dao.selectOne("SysMgr.SysOperLog.selectOperLogById", operId);
    }

    /**
     * 清空操作日志
     */
    @Override
    public void cleanOperLog() {
        dao.delete("SysMgr.SysOperLog.cleanOperLog");
    }
}
